<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>冒泡排序</title>
</head>
<body>
    <script>
        var a=[3,6,4,2,11,10,5];
        for(var i=0;i<a.length-1;i++){
            for(var j=0;j<a.length-1;j++){
                    if(a[j]>a[j+1]) {
                    var  temp = a[j];
                    a[j] = a[j + 1];
                    a[j + 1] = temp;
                     }
                 }
             }
        document.write(a);

    </script>
</body>
</html>